<ion-view class="settings" show-tabs>
  <ion-nav-bar class="bar-royal">
    <ion-nav-title>{{'Wallet Information' | translate}}</ion-nav-title>
    <ion-nav-back-button>
    </ion-nav-back-button>
  </ion-nav-bar>
  <ion-content>
    <div class="list">
      <div ng-include="'views/includes/walletItem.html'"></div>
      <div class="item" ng-click="saveBlack()">
        <span translate>Wallet Name (at creation)</span>
        <span class="item-note">
          {{walletName}}
        </span>
      </div>
      <div class="item" copy-to-clipboard="walletId">
        <span translate>Coin</span>
        <span class="item-note">
          {{wallet.coin}}
        </span>
      </div>
      <div class="item" copy-to-clipboard="walletId">
        <span translate>Wallet Id</span>
        <span class="item-note">
          {{walletId}}
        </span>
      </div>
      <div class="item">
        <span translate>Wallet Configuration (m-n)</span>
        <span class="item-note">
          {{M}}-{{N}}
        </span>
      </div>
      <div class="item">
        <span translate>Wallet Network</span>
        <span class="item-note">
          {{network}}
        </span>
      </div>
      <div class="item">
        <span translate>Address Type</span>
        <span class="item-note">
          {{addressType}}
        </span>
      </div>
      <div class="item">
        <span translate>Derivation Strategy</span>
        <span class="item-note">
          {{derivationStrategy}}
        </span>
      </div>
      <div class="item" ng-show="wallet.isPrivKeyExternal() && !externalSource.isEmbeddedHardware">
        <span translate>Hardware Wallet</span>
        <span class="item-note">
          {{externalSource}}
        </span>
      </div>
      <a class="item item-icon-right" href ui-sref="tabs.preferences.preferencesExternal" ng-show="wallet.isPrivKeyExternal() && externalSource.isEmbeddedHardware">
        <span translate>Hardware Wallet</span>
        <span class="item-note">
          {{externalSource}}
        </span>
        <i class="icon bp-arrow-right"></i>
      </a>
      <div class="item" ng-show="!wallet.isPrivKeyExternal() && !wallet.canSign()">
        <span translate></span>
        <span class="item-note">
          No private key
        </span>
      </div>
      <div class="item" ng-show="wallet.credentials.account">
        <span translate>Account</span>({{derivationStrategy}})
        <span class="item-note">
          #{{wallet.credentials.account}}
        </span>
      </div>

      <div ng-show="wallet.cachedStatus.wallet.copayers[0]" class="item item-divider">
        Copayers
      </div>

      <div class="item item-icon-right" ng-repeat="copayer in wallet.cachedStatus.wallet.copayers">
        {{copayer.name}}
        <span ng-show="copayer.id == wallet.copayerId">
          ({{'Me'|translate}})
        </span>
      </div>

      <div class="item item-divider" translate>
        Extended Public Keys
      </div>

      <div class="item" ng-repeat="pk in pubKeys" copy-to-clipboard="pk">
        <span translate>Copayer {{$index}}</span>
        <span class="item-note">
          <span>{{pk}}</span>
        <span ng-if="$index == 0">({{basePath}})</span>
        </span>
      </div>

      <div ng-if="!wallet.needsBackup && canSign">
        <div class="item item-divider"></div>
        <a class="item item-icon-right" ui-sref="tabs.preferences.preferencesPrivateKey">
          <span translate>Extended Private Key</span>
          <i class="icon bp-arrow-right"></i>
        </a>
      </div>

      <div ng-show="wallet.balanceByAddress[0]">
        <div class="item item-divider" translate>
          Balance By Address
        </div>
        <div class="item" ng-repeat="a in wallet.balanceByAddress" copy-to-clipboard="a.address">
          <span>{{a.address}}</span>
          <span class="item-note">
            {{(a.amount/1e8).toFixed(8)}} QYB
          </span>
        </div>
      </div>
    </div>
  </ion-content>
</ion-view>
